var me = this;
var vPsns = "";
var rcds = me.getItem('grdPsn').getSelectionModel().getSelection();
if (Ext.isEmpty(rcds)) {
    return;
}

Ext.each(rcds,
function(rcd) {
    vPsns += rcd.get('psn') + ',';
});

Ext.Msg.show({
    title: T.label.print,
    msg: '确定要打印吗？',
    icon: Ext.Msg.QUESTION,
    buttons: Ext.Msg.YESNO,
    fn: function(btnId) {
        if ('yes' == btnId) {
            button.setDisabled(true);

            YX.ZbusRpc.request({
                module: 'SmfrViewProductSnToPrintLabelService',
                showSuccess: false,
                params: {
                    psns: vPsns
                },
                success: function(rsp) {
                    if (!Ext.isEmpty(rsp.fileName)) {
                        var mainForm = me.getItem('frmMain');
                        Ext.create('Ext.window.Window', {
                            title: '标签打印',
                            height: mainForm.getHeight() - 50,
                            width: mainForm.getWidth() - 200,
                            layout: 'fit',
                            modal: true,
                            frame: false,
                            items: [{
                                html: '<iframe style="width:100%;height:100%" src="export?download=0&fileName=' + rsp.fileName + '"/>'
                            }]
                        }).show();

                    }
                },
                callback: function() {
                    button.setDisabled(false);
                }
            });
        }
    }
});